Optimal. Leaf size=459 \[ -\frac{\tanh ^{-1}\left (\frac{b+2 c x}{2 \sqrt{c} \sqrt{a+b x+c x^2}}\right ) \left (4 c h (-a f h-b e h+2 b f g)+b^2 f h^2-8 c^2 \left (3 f g^2-h (2 e g-d h)\right )\right )}{8 c^{3/2} h^4}-\frac{\sqrt{a+b x+c x^2} \left (2 c h^2 x \left (-a f h+b f g-2 c d h+2 c e g-\frac{3 c f g^2}{h}\right )+c h \left (4 a h (2 f g-e h)-b \left (4 d h^2-8 e g h+13 f g^2\right )\right )+b f h^2 (b g-a h)+4 c^2 g \left (3 f g^2-h (2 e g-d h)\right )\right )}{4 c h^3 \left (a h^2-b g h+c g^2\right )}-\frac{\left (a+b x+c x^2\right )^{3/2} \left (f g^2-h (e g-d h)\right )}{h (g+h x) \left (a h^2-b g h+c g^2\right )}-\frac{\tanh ^{-1}\left (\frac{-2 a h+x (2 c g-b h)+b g}{2 \sqrt{a+b x+c x^2} \sqrt{a h^2-b g h+c g^2}}\right ) \left (h \left (2 a h (2 f g-e h)-b \left (d h^2-3 e g h+5 f g^2\right )\right )+2 c g \left (3 f g^2-h (2 e g-d h)\right )\right )}{2 h^4 \sqrt{a h^2-b g h+c g^2}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 1.10023, antiderivative size = 453, normalized size of antiderivative = 0.99, number of steps used = 7, number of rules used = 6, integrand size = 32, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.188, Rules used = {1650, 814, 843, 621, 206, 724} \[ -\frac{\tanh ^{-1}\left (\frac{b+2 c x}{2 \sqrt{c} \sqrt{a+b x+c x^2}}\right ) \left (4 c h (-a f h-b e h+2 b f g)+b^2 f h^2-8 c^2 \left (3 f g^2-h (2 e g-d h)\right )\right )}{8 c^{3/2} h^4}-\frac{\sqrt{a+b x+c x^2} \left (2 c h x \left (-a f h+b f g-2 c d h+2 c e g-\frac{3 c f g^2}{h}\right )+b f h (b g-a h)+4 a c h (2 f g-e h)-b c \left (4 d h^2-8 e g h+13 f g^2\right )-4 c^2 g \left (-d h+2 e g-\frac{3 f g^2}{h}\right )\right )}{4 c h^2 \left (a h^2-b g h+c g^2\right )}-\frac{\left (a+b x+c x^2\right )^{3/2} \left (f g^2-h (e g-d h)\right )}{h (g+h x) \left (a h^2-b g h+c g^2\right )}-\frac{\tanh ^{-1}\left (\frac{-2 a h+x (2 c g-b h)+b g}{2 \sqrt{a+b x+c x^2} \sqrt{a h^2-b g h+c g^2}}\right ) \left (2 c \left (3 f g^3-g h (2 e g-d h)\right )-h \left (-2 a h (2 f g-e h)-b h (3 e g-d h)+5 b f g^2\right )\right )}{2 h^4 \sqrt{a h^2-b g h+c g^2}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 1650
Rule 814
Rule 843
Rule 621
Rule 206
Rule 724
Rubi steps
\begin{align*} \int \frac{\sqrt{a+b x+c x^2} \left (d+e x+f x^2\right )}{(g+h x)^2} \, dx &=-\frac{\left (f g^2-h (e g-d h)\right ) \left (a+b x+c x^2\right )^{3/2}}{h \left (c g^2-b g h+a h^2\right ) (g+h x)}-\frac{\int \frac{\left (\frac{1}{2} \left (-2 c d g+3 b e g+2 a f g-\frac{3 b f g^2}{h}-b d h-2 a e h\right )+\left (2 c e g+b f g-\frac{3 c f g^2}{h}-2 c d h-a f h\right ) x\right ) \sqrt{a+b x+c x^2}}{g+h x} \, dx}{c g^2-b g h+a h^2}\\ &=-\frac{\left (b f h (b g-a h)-4 c^2 g \left (2 e g-\frac{3 f g^2}{h}-d h\right )+4 a c h (2 f g-e h)-b c \left (13 f g^2-8 e g h+4 d h^2\right )+2 c h \left (2 c e g+b f g-\frac{3 c f g^2}{h}-2 c d h-a f h\right ) x\right ) \sqrt{a+b x+c x^2}}{4 c h^2 \left (c g^2-b g h+a h^2\right )}-\frac{\left (f g^2-h (e g-d h)\right ) \left (a+b x+c x^2\right )^{3/2}}{h \left (c g^2-b g h+a h^2\right ) (g+h x)}+\frac{\int \frac{-\frac{\left (c g^2-b g h+a h^2\right ) \left (b^2 f g h+4 a c h (3 f g-2 e h)-4 b c \left (3 f g^2-h (2 e g-d h)\right )\right )}{2 h}-\frac{\left (c g^2-b g h+a h^2\right ) \left (b^2 f h^2+4 c h (2 b f g-b e h-a f h)-8 c^2 \left (3 f g^2-h (2 e g-d h)\right )\right ) x}{2 h}}{(g+h x) \sqrt{a+b x+c x^2}} \, dx}{4 c h^2 \left (c g^2-b g h+a h^2\right )}\\ &=-\frac{\left (b f h (b g-a h)-4 c^2 g \left (2 e g-\frac{3 f g^2}{h}-d h\right )+4 a c h (2 f g-e h)-b c \left (13 f g^2-8 e g h+4 d h^2\right )+2 c h \left (2 c e g+b f g-\frac{3 c f g^2}{h}-2 c d h-a f h\right ) x\right ) \sqrt{a+b x+c x^2}}{4 c h^2 \left (c g^2-b g h+a h^2\right )}-\frac{\left (f g^2-h (e g-d h)\right ) \left (a+b x+c x^2\right )^{3/2}}{h \left (c g^2-b g h+a h^2\right ) (g+h x)}-\frac{\left (b^2 f h^2+4 c h (2 b f g-b e h-a f h)-8 c^2 \left (3 f g^2-h (2 e g-d h)\right )\right ) \int \frac{1}{\sqrt{a+b x+c x^2}} \, dx}{8 c h^4}-\frac{\left (2 c \left (3 f g^3-g h (2 e g-d h)\right )-h \left (5 b f g^2-b h (3 e g-d h)-2 a h (2 f g-e h)\right )\right ) \int \frac{1}{(g+h x) \sqrt{a+b x+c x^2}} \, dx}{2 h^4}\\ &=-\frac{\left (b f h (b g-a h)-4 c^2 g \left (2 e g-\frac{3 f g^2}{h}-d h\right )+4 a c h (2 f g-e h)-b c \left (13 f g^2-8 e g h+4 d h^2\right )+2 c h \left (2 c e g+b f g-\frac{3 c f g^2}{h}-2 c d h-a f h\right ) x\right ) \sqrt{a+b x+c x^2}}{4 c h^2 \left (c g^2-b g h+a h^2\right )}-\frac{\left (f g^2-h (e g-d h)\right ) \left (a+b x+c x^2\right )^{3/2}}{h \left (c g^2-b g h+a h^2\right ) (g+h x)}-\frac{\left (b^2 f h^2+4 c h (2 b f g-b e h-a f h)-8 c^2 \left (3 f g^2-h (2 e g-d h)\right )\right ) \operatorname{Subst}\left (\int \frac{1}{4 c-x^2} \, dx,x,\frac{b+2 c x}{\sqrt{a+b x+c x^2}}\right )}{4 c h^4}+\frac{\left (2 c \left (3 f g^3-g h (2 e g-d h)\right )-h \left (5 b f g^2-b h (3 e g-d h)-2 a h (2 f g-e h)\right )\right ) \operatorname{Subst}\left (\int \frac{1}{4 c g^2-4 b g h+4 a h^2-x^2} \, dx,x,\frac{-b g+2 a h-(2 c g-b h) x}{\sqrt{a+b x+c x^2}}\right )}{h^4}\\ &=-\frac{\left (b f h (b g-a h)-4 c^2 g \left (2 e g-\frac{3 f g^2}{h}-d h\right )+4 a c h (2 f g-e h)-b c \left (13 f g^2-8 e g h+4 d h^2\right )+2 c h \left (2 c e g+b f g-\frac{3 c f g^2}{h}-2 c d h-a f h\right ) x\right ) \sqrt{a+b x+c x^2}}{4 c h^2 \left (c g^2-b g h+a h^2\right )}-\frac{\left (f g^2-h (e g-d h)\right ) \left (a+b x+c x^2\right )^{3/2}}{h \left (c g^2-b g h+a h^2\right ) (g+h x)}-\frac{\left (b^2 f h^2+4 c h (2 b f g-b e h-a f h)-8 c^2 \left (3 f g^2-h (2 e g-d h)\right )\right ) \tanh ^{-1}\left (\frac{b+2 c x}{2 \sqrt{c} \sqrt{a+b x+c x^2}}\right )}{8 c^{3/2} h^4}-\frac{\left (2 c \left (3 f g^3-g h (2 e g-d h)\right )-h \left (5 b f g^2-b h (3 e g-d h)-2 a h (2 f g-e h)\right )\right ) \tanh ^{-1}\left (\frac{b g-2 a h+(2 c g-b h) x}{2 \sqrt{c g^2-b g h+a h^2} \sqrt{a+b x+c x^2}}\right )}{2 h^4 \sqrt{c g^2-b g h+a h^2}}\\ \end{align*}
Mathematica [A] time = 1.69481, size = 486, normalized size = 1.06 \[ \frac{-\frac{\frac{\left (h (a h-b g)+c g^2\right ) \tanh ^{-1}\left (\frac{b+2 c x}{2 \sqrt{c} \sqrt{a+x (b+c x)}}\right ) \left (4 c h (a f h+b e h-2 b f g)-b^2 f h^2+8 c^2 \left (h (d h-2 e g)+3 f g^2\right )\right )}{\sqrt{c}}+2 h \sqrt{a+x (b+c x)} \left (c h (2 a h (2 e h-4 f g+f h x)+4 b h (d h-2 e g)+b f g (13 g-2 h x))+b f h^2 (a h-b g)+c^2 \left (4 h (d h (h x-g)+e g (2 g-h x))+6 f g^2 (h x-2 g)\right )\right )+4 c \sqrt{h (a h-b g)+c g^2} \tanh ^{-1}\left (\frac{2 a h-b g+b h x-2 c g x}{2 \sqrt{a+x (b+c x)} \sqrt{h (a h-b g)+c g^2}}\right ) \left (2 c \left (g h (d h-2 e g)+3 f g^3\right )-h \left (2 a h (e h-2 f g)+b h (d h-3 e g)+5 b f g^2\right )\right )}{4 h^3 \left (h (b g-a h)-c g^2\right )}-\frac{(a+x (b+c x))^{3/2} \left (f h (a h-b g)+2 c h (d h-e g)+3 c f g^2\right )}{(g+h x) \left (h (a h-b g)+c g^2\right )}+\frac{f (a+x (b+c x))^{3/2}}{g+h x}}{2 c h} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.273, size = 6218, normalized size = 13.6 \begin{align*} \text{output too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: TypeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]